
* Importing packages
* ssc install estout
* ssc install ftools
* ssc install reghdfe
* ssc install cibar
* ssc install rev
* ssc install sutex
* ssc install cibar
* ssc install ipfweight
* ssc install ciplot


**************************************************************************************************
*****************A) Germany dataset.  ************************************************************
**************************************************************************************************


cd "[insert your directory]"

use "DE_stage3.dta",   clear

global PathTab "[insert your directory]"
global PathFig "[insert your directory]"


* Recoding key variables

recode treatment (2 7 1 6 = 1 "Gender") (4 9 3 8 = 2 "Welfare") (5 10 = 3 "Control"), gen(norm_type)
recode treatment (6/10 = 0 "Natives") (1/5=1 "Immigrants"), gen(treat_nation_fig)
recode treatment (10 = 2 "Native control") (5 = 5 "Immigrant control") (7 9  = 1 "Native regressive") (2 4 = 4 "Immigrant regressive") (6 8 = 3 "Native progressive") (1 3 = 6 "Immigrant progressive"), gen(treat_fig_labeled) 
recode treatment (2 4 7 9 = 1 "Violation") (1 3 6 8 = 2 "Compliance") (5 10 = 0 "Control"), gen(treat_adherance)


gen therm = closeness*100
rename closeness therm_01
rename help help_01


foreach var of varlist DSC_1 DSC_2 DSC_3 DSC_4 DSC_5 DSC_6{
	gen `var'_num = 1 if `var'=="Extremely uncomfortable"
	replace `var'_num = 2 if `var'=="Somewhat uncomfortable"
	replace `var'_num = 3 if `var'=="Neither comfortable nor uncomfortable"
	replace `var'_num = 4 if `var'=="Somewhat comfortable"
	replace `var'_num = 5 if `var'=="Extremely comfortable"
}
egen desired_contact = rowmean(DSC_1_num DSC_2_num DSC_3_num DSC_4_num DSC_5_num DSC_6_num )
gen desired_contact_01 = (desired_contact-1)/4

label variable help_01 "Help"
label variable desired_contact_01 "Desired Contact"
label variable therm_01 "Closeness"



foreach var of varlist policy_pretreat_4 policy_pretreat_6 {
	gen `var'_enc = 1 if `var'=="Strongly agree"
	replace `var'_enc = 2 if `var'=="Agree"
	replace `var'_enc = 3 if `var'=="Neither agree nor disagree"
	replace `var'_enc = 4 if `var'=="Disagree"
	replace `var'_enc = 5 if `var'=="Strongly disagree"
}

rename PC_1 political_correct


foreach var of varlist Income Edu Religion Party{
	encode `var', gen(`var'_enc)
}


// Right/Center-right parties include: AfD, CDU/CSU, and FDP.
gen right_wing_DE = 1 if party=="AfD" | party=="CDU/CSU" | party=="FDP"
replace right_wing_DE = 0 if party=="Bündnis90/Grüne" | party=="Die Linke" | party=="SPD"
replace right_wing_DE = . if party=="I would not vote" | party=="Other party"


gen postsecondary_DE = 0 if Edu_enc!=.
replace postsecondary_DE = 1 if Edu_enc==9 | Edu_enc==6 | Edu_enc==5 | Edu_enc==3
recode Religion_enc (1=1) (else=0), gen(Christian)
ta FederalState, gen(region_DE)
recode age (18/34 = 1 "Age 18-34") (35/54 = 2 "Age 35/54") (55/90 = 3 "Age 55/90") (else = .), gen(age_cat)

recode Income_enc (6=.), gen(income_1_noNA)


save "DE_recoded_stage_3.dta", replace



** Figure S5: Germany panel

ciplot therm_01 , by(treat_fig_labeled) name(a2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Germany") aspectratio(.8)
graph export "${PathFig}FigureS5_DE.eps", as(eps) replace



gen treat_adherance2 = 0 if treat_adherance==1
replace treat_adherance2 = 1 if treat_adherance==2
gen norm_type2 = 0 if norm_type==1
replace norm_type2 =1 if norm_type==2


label variable age "Age"
label variable FemaleSub "Female"
label variable postsecondary_DE "Post-sec. educ."
label variable Christian "Christian"
label variable income_1_noNA "Income"
label var region_DE1 "Baden-Württemberg"
label var region_DE2 "Bayern"
label var region_DE3 "Berlin"
label var region_DE4 "Brandenburg"
label var region_DE5 "Bremen"
label var region_DE6 "Hamburg"
label var region_DE7 "Hessen"
label var region_DE8 "Mecklenburg-Vorpommern"
label var region_DE9 "Niedersachsen"
label var region_DE10 "Nordrhein-Westfalen"
label var region_DE11 "Rheinland-Pfalz"
label var region_DE12 "Saarland"
label var region_DE13 "Sachsen"
label var region_DE14 "Sachsen-Anhalt"
label var region_DE15 "Schleswig-Holstein"
label var region_DE16 "Thüringen"



* ssc install ietoolkit

** Table S12
// NATIVE VS IMMIGRANT CONDITION
iebaltab age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA, group(treat_nation_fig) total ftest format(%9.2fc) rowvarlabels  savet("${PathTab}TableS12.tex") star(0.05 0.01 0.001) replace  
* calculate F-tests
reg treat_nation_fig age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA
testparm age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA

** Table S13
// NORM ADHERENCE VS VIOLATION CONDITION 
iebaltab age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA, group(treat_adherance2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS13.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg treat_adherance2 age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA
testparm age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA

** Table S14
// GENDER EQAULITY VS WELFARE NORM CONDITION
iebaltab age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA, group(norm_type2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS14.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg norm_type2 age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA
testparm age FemaleSub postsecondary_DE region_DE1-region_DE16 Christian income_1_noNA





**************************************************************************************************
*****************B) Greece dataset.   ************************************************************
**************************************************************************************************


cd "[insert your directory]"

global PathTab "[insert your directory]"
global PathFig "[insert your directory]"

use "GR_stage3.dta", clear


* Recoding key variables

recode condition (2 7 1 6 = 1 "Gender") (4 9 3 8 = 2 "Welfare") (5 10 = 3 "Control"), gen(norm_type)
recode condition (10 = 2 "Native control") (5 = 5 "Immigrant control") (7 9  = 1 "Native regressive") (2 4 = 4 "Immigrant regressive") (6 8 = 3 "Native progressive") (1 3 = 6 "Immigrant progressive"), gen(treat_fig_labeled) 
recode condition (6/10 = 0 "Natives") (1/5=1 "Immigrants"), gen(treat_nation_fig)
recode condition (2 4 7 9 = 1 "Violation") (1 3 6 8 = 2 "Compliance") (5 10 = 0 "Control"), gen(treat_adherance)
rename condition treatment


rename FEMALE FemaleSub 
rev shownmale, gen(FemaleConf)
label variable FemaleConf "Female (vs) male confederate"


rename THERM therm
gen help_rev=6-HELP1
rename help_rev help
egen desired_contact_temp = rowmean(DISTANCE_A1 - DISTANCE_A6)
gen desired_contact = 6-desired_contact_temp

gen desired_contact_01 = (desired_contact-1)/4
gen help_01 = (help-1)/4
gen therm_01 = therm/100

label variable help_01 "Help"
label variable desired_contact_01 "Desired Contact"
label variable therm_01 "Closeness"


gen political_correct = 1 if PC1<2
replace political_correct = 0 if PC1>=2


// Right/Center-right political parties include: ΝΕΑ  ΔΗΜΟΚΡΑΤΙΑ, ΕΛΛΗΝΙΚΗ  ΛΥΣΗ, ΕΘΝΙΚΗ ΔΗΜΙΟΥΡΓΙΑ (ΔΗΜΙΟΥΡΓΙΑ ΞΑΝΑ+ΝΕΑ  ΔΕΞΙΑ), ΕΛΛΗΝΩΝ ΣΥΝΕΛΕΥΣΙΣ, ΕΘΝΙΚΟ ΚΟΜΜΑ ΕΛΛΗΝΕΣ (κόμμα Κασιδιάρη), ΠΑΤΡΙΔΑ (κόμμα Μπογδάνου)
gen right_wing_GR = 1 if PARTYCHOICE==1 | PARTYCHOICE==5 | PARTYCHOICE==9 |PARTYCHOICE==13 | PARTYCHOICE==14  | PARTYCHOICE==15
replace right_wing_GR = 0 if PARTYCHOICE==2 | PARTYCHOICE==3 |PARTYCHOICE==4 | PARTYCHOICE==6 | PARTYCHOICE==7  | PARTYCHOICE==11 | PARTYCHOICE==12


recode RELIGION (1=1) (else=0), gen(Greek_Orthodox) 
rename postsecondary postsecondary_GR

recode INCOME_1 (6=.), gen(income_1_noNA)

rename region1 region_GR1
rename region2 region_GR2
rename region3 region_GR3
rename region4 region_GR4

save "GR_recoded_stage_3.dta", replace


** Figure S5: Greece panel

ciplot therm_01 , by(treat_fig_labeled) name(a2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Greece") aspectratio(.8)
graph export "${PathFig}FigureS5_GR.eps", as(eps) replace


gen treat_adherance2 = 0 if treat_adherance==1
replace treat_adherance2 = 1 if treat_adherance==2
gen norm_type2 = 0 if norm_type==1
replace norm_type2 =1 if norm_type==2


label variable AGE "Age"
label variable FemaleSub "Female"
label variable postsecondary_GR "Post-sec. educ."
label variable Greek_Orthodox "Orthodox"
label variable income_1_noNA "Income"
label variable region_GR1	"Attiki"
label variable region_GR2	"Voreia Ellada"
label variable region_GR3	"Kentriki Ellada"
label variable region_GR4	"Nisia Aigaiou and Kriti"


* ssc install ietoolkit

** Table S15
// NATIVE VS IMMIGRANT CONDITION
iebaltab AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA, group(treat_nation_fig) total ftest format(%9.2fc) rowvarlabels  savet("${PathTab}TableS15.tex") star(0.05 0.01 0.001) replace  
* calculate F-tests
reg treat_nation_fig AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA
testparm AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA

** Table S16
// NORM ADHERENCE VS VIOLATION CONDITION 
iebaltab AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA, group(treat_adherance2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS16.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg treat_adherance2 AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA
testparm AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA

** Table S17
// GENDER EQAULITY VS WELFARE NORM CONDITION
iebaltab AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA, group(norm_type2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS17.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg norm_type2 AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA
testparm AGE FemaleSub postsecondary_GR region_GR1-region_GR4 Greek_Orthodox income_1_noNA




**************************************************************************************************
*****************C) Poland dataset.   ************************************************************
**************************************************************************************************


cd "[insert your directory]"

use "PL_stage3.dta",   clear

global PathTab "[insert your directory]"
global PathFig "[insert your directory]"


recode Condition_Label (5 6 19 20 = 1 "Gender") (1 2 15 16 = 2 "Welfare") (7 21 = 3 "Control") (else = .), gen(norm_type)
recode Condition_Label		(1=12	"SAConPro") (2=13	"SAConAnti") (5=6	"SAAccPro") (6=7	"SAAccAnti") (7=3	"SAControl") (15=14	"PLConPro") (16=15	"PLConAnti") (19=8	"PLAccPro") (20=9	"PLAccAnti") (21=1	"PLControl"), gen(treatment)
gen treat_adherance = 2 if treatment==12  | treatment==6  | treatment==14  | treatment==8  
replace treat_adherance = 0 if treatment==1 | treatment==3
replace treat_adherance = 1 if treatment==13 | treatment==7 | treatment==15 | treatment==9 
label define adherence 2 "Compliance" 0 "Control" 1 "Violation", replace
label values treat_adherance adherence
recode treatment (14 15 8 9 1 = 0 "Natives") (12 13 6 7 3 = 1 "Immigrants"), gen(treat_nation_fig)
egen treat_fig = group(treat_adherance treat_nation_fig)
recode treat_fig (1 = 2 "Native control") (2 = 5 "Immigrant control") (3 = 1 "Native regressive") (4 = 4 "Immigrant regressive") (5 = 3 "Native progressive") (6 = 6 "Immigrant progressive"), gen(treat_fig_labeled) 


gen help_rev=6-help1
rename help_rev help
egen desired_contact = rowmean(distance_r1 distance_r2 distance_r3 distance_r4 distance_r5 distance_r6)

gen desired_contact_01 = (desired_contact-1)/4
gen help_01 = (help-1)/4
gen therm_01 = therm/100

label variable help_01 "Help"
label variable desired_contact_01 "Desired Contact"
label variable therm_01 "Closeness"


gen political_correct = 1 if pc1>4
replace political_correct = 0 if pc1<=4

// Right/Center-Right parties include: Konfederacja, PiS/Porozumienie/Solidarna Polska, Kukiz
gen right_wing_PL = 1 if partychoice==1 | partychoice==4 | partychoice==5
replace right_wing_PL = 0 if partychoice==2| partychoice==3

gen postsecondary_PL = 1 if education>4
replace postsecondary_PL = 0 if education<5
replace postsecondary_PL = . if education==8 
ta p1, gen(region_PL)
gen R_age=2023-year
recode R_age (18/34 = 1 "Age 18-34") (35/54 = 2 "Age 35/54") (55/90 = 3 "Age 55/90") (else = .), gen(age_cat)

gen conservative = 0 
replace conservative = 1 if partychoice==1 | partychoice==4 | partychoice==5
recode calibrate_1_womenincome 6=.
rev calibrate_1_womenincome, gen(sexism)
recode religion (1/4 = 1) (5 = 0) , gen(religious_pl)
gen Catholic=1 if religion==2
replace Catholic=0 if Catholic==.

recode income_1 (6=.), gen(income_1_noNA)

recode sex 1=0 2=1 3=1 4=., gen(FemaleSub) //coding "other" as missing
label var FemaleSub "Female respondent"
recode los_sex (1 = 1 "Female conf.") (2 = 0 "Male conf."), gen(FemaleConf)
label variable FemaleConf "Female (vs) male confederate"


save "PL_recoded_stage_3.dta", replace


** Figure S5: Poland panel

ciplot therm_01 , by(treat_fig_labeled) name(a2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Poland") aspectratio(.8)
graph export "${PathFig}FigureS5_PL.eps", as(eps) replace



gen treat_adherance2 = 0 if treat_adherance==1
replace treat_adherance2 = 1 if treat_adherance==2
gen norm_type2 = 0 if norm_type==1
replace norm_type2 =1 if norm_type==2


label variable R_age "Age"
label variable FemaleSub "Female"
label variable postsecondary_PL "Post-sec. educ."
label variable Catholic "Catholic"
label variable income_1_noNA "Income"
label variable region_PL1	"dolnośląskie"
label variable region_PL2	"kujawsko-pomorskie"
label variable region_PL3	"lubelskie"
label variable region_PL4	"lubuskie"
label variable region_PL5	"łódzkie"
label variable region_PL6	"małopolskie"
label variable region_PL7	"mazowieckie"
label variable region_PL8	"opolskie"
label variable region_PL9	"podkarpackie"
label variable region_PL10	"podlaskie"
label variable region_PL11	"pomorskie"
label variable region_PL12	"śląskie"
label variable region_PL13	"świętokrzyskie"
label variable region_PL14	"warmińsko-mazurskie"
label variable region_PL15	"wielkopolskie"
label variable region_PL16	"zachodniopomorskie"



* ssc install ietoolkit

** Table S18
// NATIVE VS IMMIGRANT CONDITION
iebaltab R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA, group(treat_nation_fig) total ftest format(%9.2fc) rowvarlabels  savet("${PathTab}TableS18.tex") star(0.05 0.01 0.001) replace  
* calculate F-tests
reg treat_nation_fig R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA
testparm R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA

** Table S19
// NORM ADHERENCE VS VIOLATION CONDITION 
iebaltab R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA, group(treat_adherance2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS19.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg treat_adherance2 R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA
testparm R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA

** Table S20
// GENDER EQAULITY VS WELFARE NORM CONDITION
iebaltab R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA, group(norm_type2) total ftest format(%9.2fc) rowvarlabels savet("${PathTab}TableS20.tex") star(0.05 0.01 0.001) replace
* calculate F-tests
reg norm_type2 R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA
testparm R_age FemaleSub postsecondary_PL region_PL1-region_PL16 Catholic income_1_noNA




**************************************************************************************************
*****************D) MERGE datasets.   ************************************************************
**************************************************************************************************


cd "[insert your directory]"


global PathTab "[insert your directory]"
global PathFig "[insert your directory]"


use "DE_recoded_stage_3.dta", clear

gen country = "Germany"

append using "GR_recoded_stage_3.dta", force

replace country = "Greece" if missing(country)


append using "PL_recoded_stage_3.dta", force

replace country = "Poland" if missing(country)

label variable country "Sample"


** define controls
* German controls
global controls_de = "FemaleSub i.age_cat postsecondary_DE Christian i.Income_enc region_DE1-region_DE16 policy_pretreat_4_enc policy_pretreat_6_enc" 
* Greek controls
 global controls_gr = "FemaleSub  i.age_cat postsecondary_GR Greek_Orthodox i.INCOME_1 region_GR1-region_GR4 POLICY_PRETREAT_A4 POLICY_PRETREAT_A6" 
 * Polish controls
global controls_pl = "FemaleSub i.age_cat postsecondary_PL Catholic i.income_1 region_PL1-region_PL16 policy_pretreat_r4 policy_pretreat_r6" 


** Tables S7, S9, S11 (summary statistics) 
tab age_cat, gen(age_cat)
sutex FemaleSub age_cat1 age_cat2 age_cat3  postsecondary_DE region_DE1-region_DE16 right_wing_DE if country=="Germany", minmax labels title("Summary statistics, German sample (stage 3)") file("${PathTab}TableS7.tex") replace
sutex FemaleSub age_cat1 age_cat2 age_cat3  postsecondary_GR region_GR1-region_GR4 right_wing_GR if country=="Greece", minmax labels title("Summary statistics, Greek sample (stage 3)") file("${PathTab}TableS9.tex") replace
sutex FemaleSub age_cat1 age_cat2 age_cat3  postsecondary_PL region_PL1-region_PL16 right_wing_PL if country=="Poland" , minmax labels title("Summary statistics, Polish sample (stage 3)") file("${PathTab}TableS11.tex") replace


** Heterogeneity by *individual-level* 
* i/ prejudice (proxy for anti-imm stereotypes) & ii/ work ethics (proxy for welfare norm salience)
* can only be done in Greece and Poland (no pre-treat data in Germany)

** individual-level prejudice
* Greece
foreach var of varlist CRIME{
	recode `var' 6/7=.
}
rev CRIME , gen(CRIME_rev)
egen pre_treat_imm_temp_GR = rowmean(CRIME_rev )
* Poland
foreach var of varlist calibrate_1_crime {
	recode `var' 6=.
}
rev calibrate_1_crime , gen(calibrate_1_crime_rev)
egen pre_treat_imm_temp_PL = rowmean(calibrate_1_crime_rev )
* combined variable PL and GR
gen pre_treat_imm = pre_treat_imm_temp_GR
replace pre_treat_imm = pre_treat_imm_temp_PL if pre_treat_imm==.
replace pre_treat_imm=. if country=="Germany"

** individual-level work ethics
* Greece
recode DUTY 6/7=.
rev DUTY, gen(DUTY_rev)
* Poland
recode calibrate_1_duty 6=.
rev calibrate_1_duty, gen(calibrate_1_duty_rev)
* combined variable PL and GR
gen pre_treat_work = DUTY_rev
replace pre_treat_work = calibrate_1_duty_rev if pre_treat_work==.
replace pre_treat_work=. if country=="Germany"

** individual-level gender equity
* Greece
recode WOMENINCOME 6/7=.
* Poland
recode calibrate_1_womenincome 6=.
* combined variable PL and GR
gen pre_treat_gender = WOMENINCOME
replace pre_treat_gender = calibrate_1_womenincome if pre_treat_gender==.
replace pre_treat_gender=. if country=="Germany"


** code control variables for analyses on *pooled* Greek and Polish samples
gen postsecondary_GR_PL = postsecondary_GR if country=="Greece"
replace postsecondary_GR_PL = postsecondary_PL if country=="Poland"
gen income_GR_PL = INCOME_1 if country=="Greece"
replace income_GR_PL = income_1 if country=="Poland"
gen prepolicy4_GR_PL = POLICY_PRETREAT_A4 if country=="Greece"
replace prepolicy4_GR_PL = policy_pretreat_r4 if country=="Poland"
gen prepolicy6_GR_PL = POLICY_PRETREAT_A6 if country=="Greece"
replace prepolicy6_GR_PL = policy_pretreat_r6 if country=="Poland"
* define controls for pooled analyses
global controls_gr_pl = "FemaleSub i.age_cat postsecondary_GR_PL i.income_GR_PL prepolicy4_GR_PL prepolicy6_GR_PL" 
tab country, gen(cntr)
label variable cntr2 "Poland (vs. Greece)"

** assign Greek and Polish respondents to 2x2 conceptual table (by norm salience and stereotypes/suprise) 
* welfare norms
gen two_by_two_work = 1 if  pre_treat_work>=4 & pre_treat_imm>=3 & country!="Germany"
replace two_by_two_work = 2 if  pre_treat_work>=4 & pre_treat_imm<3 & country!="Germany"
replace two_by_two_work = 3 if  pre_treat_work<4 & pre_treat_imm>=3 & country!="Germany"
replace two_by_two_work = 4 if  pre_treat_work<4 & pre_treat_imm<3 & country!="Germany"
* gender norms
gen two_by_two_gender = 1 if  pre_treat_gender>=4 & pre_treat_imm>=3 & country!="Germany"
replace two_by_two_gender = 2 if  pre_treat_gender>=4 & pre_treat_imm<3 & country!="Germany"
replace two_by_two_gender = 3 if  pre_treat_gender<4 & pre_treat_imm>=3 & country!="Germany"
replace two_by_two_gender = 4 if  pre_treat_gender<4 & pre_treat_imm<3 & country!="Germany"




** Figure 3 (descriptive plots)

ciplot therm_01 if norm_type!=1 & country=="Germany", by(treat_fig_labeled) name(a1, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title ("Welfare norm") ylabel(.2(.1).7) scale(1.5)
ciplot therm_01 if norm_type!=2 & country=="Germany", by(treat_fig_labeled) name(a2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Gender equity norm") ylabel(.2(.1).7) scale(1.5)
gr combine a1 a2 , col(2) ycommon title("{bf: Germany}")
graph export "${PathFig}Figure3_DE.eps", as(eps) replace


ciplot therm_01 if norm_type!=1 & country=="Greece", by(treat_fig_labeled) name(b1, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title ("Welfare norm") ylabel(.2(.1).7) scale(1.5)
ciplot therm_01 if norm_type!=2 & country=="Greece", by(treat_fig_labeled) name(b2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Gender equity norm") ylabel(.2(.1).7) scale(1.5)
gr combine b1 b2 , col(2) ycommon title("{bf: Greece}")
graph export "${PathFig}Figure3_GR.eps", as(eps) replace


ciplot therm_01 if norm_type!=1 & country=="Poland", by(treat_fig_labeled) name(c1, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title ("Welfare norm") ylabel(.2(.1).7) scale(1.5)
ciplot therm_01 if norm_type!=2 & country=="Poland", by(treat_fig_labeled) name(c2, replace) note("") xlabel(, angle(45)) xtitle("")  xline(9.5) rcap(lcolor(black)) title("Gender equity norm") ylabel(.2(.1).7) scale(1.5)
gr combine c1 c2 , col(2) ycommon title("{bf: Poland}")
graph export "${PathFig}Figure3_PL.eps", as(eps) replace


** Table 3 (main regression table)

eststo clear
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/Table3.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/Table3.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/Table3.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/Table3.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/Table3.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/Table3.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S23 

eststo clear
reg therm_01 i.treat_nation_fig  if country=="Germany"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, No, Country, Germany)  replace
reg therm_01 i.treat_nation_fig  $controls_de if country=="Germany"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes, Country, Germany)  append
reg therm_01 i.treat_nation_fig if country=="Greece"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, No, Country, Greece)  append
reg therm_01 i.treat_nation_fig $controls_gr if country=="Greece"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes, Country, Greece)  append
reg therm_01 i.treat_nation_fig  if  country=="Poland"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, No, Country, Poland)  append
reg therm_01 i.treat_nation_fig $controls_pl if  country=="Poland"
outreg2 using $PathTab/TableS23.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes, Country, Poland)  append


** Figure S6

hist therm_01 if norm_type!=2  & norm_type!=. & country=="Poland" & treat_nation_fig==0 & treat_adherance==1, title(Violation) name(viol1, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Poland" & treat_nation_fig==0 & treat_adherance==2, title(Compliance) name(adh1, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Poland" & treat_nation_fig==0 & treat_adherance==0, title(Control) name(con1, replace)
gr combine viol1 con1  adh1 , col(3) title(Gender equity norm in Poland) name(x1, replace)

hist therm_01 if norm_type!=2  & norm_type!=. & country=="Germany" & treat_nation_fig==0 & treat_adherance==1, title(Violation) name(viol2, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Germany" & treat_nation_fig==0 & treat_adherance==2, title(Compliance) name(adh2, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Germany" & treat_nation_fig==0 & treat_adherance==0, title(Control) name(con2, replace)
gr combine viol2 con2  adh2 , col(3) title(Gender equity norm in Germany) name(x2, replace)

hist therm_01 if norm_type!=2  & norm_type!=. & country=="Greece" & treat_nation_fig==0 & treat_adherance==1, title(Violation) name(viol3, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Greece" & treat_nation_fig==0 & treat_adherance==2, title(Compliance) name(adh3, replace)
hist therm_01 if norm_type!=2  & norm_type!=. & country=="Greece" & treat_nation_fig==0 & treat_adherance==0, title(Control) name(con3, replace)
gr combine viol1 con1  adh1 , col(3) title(Gender equity norm in Grrece) name(x3, replace)

gr combine x1 x2 x3, col(1)
graph export "${PathFig}FigureS6.eps", as(eps) replace


** Table S24

eststo
reg therm_01 i.treat_adherance##conservative $controls_pl if norm_type!=2   & country=="Poland"
outreg2 using $PathTab/TableS24.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes)  replace
reg therm_01 i.treat_adherance##c.sexism $controls_pl if norm_type!=2   & country=="Poland"
outreg2 using $PathTab/TableS24.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes)  append
reg therm_01 i.treat_adherance##religious_pl $controls_pl if norm_type!=2   & country=="Poland"
outreg2 using $PathTab/TableS24.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Controls, Yes)  append


** Table S25

eststo clear
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & political_correct!=1 & country=="Germany"
outreg2 using $PathTab/TableS25.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & political_correct!=1 & country=="Germany"
outreg2 using $PathTab/TableS25.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & political_correct!=1 & country=="Greece"
outreg2 using $PathTab/TableS25.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & political_correct!=1 & country=="Greece"
outreg2 using $PathTab/TableS25.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 treat_adherance##treat_nation_fig if norm_type!=1 & political_correct!=1 & country=="Poland"
outreg2 using $PathTab/TableS25.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & political_correct!=1 & country=="Poland"
outreg2 using $PathTab/TableS25.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append

** Table S31

pca therm_01 help_01 desired_contact_01
predict general_attitude_pca

eststo clear
reg general_attitude_pca treat_adherance##treat_nation_fig if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/TableS31.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg general_attitude_pca i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/TableS31.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg general_attitude_pca treat_adherance##treat_nation_fig if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/TableS31.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg general_attitude_pca i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/TableS31.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg general_attitude_pca treat_adherance##treat_nation_fig if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/TableS31.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg general_attitude_pca i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/TableS31.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Figure S8

label define political_correct 1 "PC" 0 "Non-PC"
label values political_correct political_correct

foreach var of varlist therm_01 desired_contact_01 help_01{
	eststo `var': reg `var' i.political_correct##treat_nation_fig if norm_type!=.
}
	coefplot (therm_01, label("Closeness"))  (help_01, label("Willingness to help"))  (desired_contact_01, label("Desired contact")) , label xline(0) drop(_cons) title("All countries") level(95 90)
	graph export "${PathFig}FigureS8.eps", as(eps) replace


** Figure S9

foreach var of varlist therm_01 desired_contact_01 help_01{
	eststo `var': reg `var' i.treat_nation_fig if norm_type!=.
}

	coefplot (therm_01, label("Closeness")) (help_01, label("Willingness to help"))  (desired_contact_01, label("Desired contact"))  , label xline(0) drop(_cons) title("All countries") 
		graph export "${PathFig}FigureS9.eps", as(eps) replace


** Figure S10

encode country, gen(country_enc)
label define FemaleConf 1 "Female confederate" 0 "Male confederate", replace
label values FemaleConf FemaleConf
gen Help = help_01
cibar Help, over1(FemaleConf) over2(country_enc) blf(%9.3f) 
graph export "${PathFig}FigureS10.eps", as(eps) replace


** Table S33

eststo clear
reg help_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/TableS33.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg help_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/TableS33.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg help_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/TableS33.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg help_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/TableS33.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg help_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/TableS33.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg help_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/TableS33.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S34

eststo clear
reg desired_contact_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/TableS34.tex, tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg desired_contact_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/TableS34.tex,  tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg desired_contact_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/TableS34.tex, tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg desired_contact_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/TableS34.tex,  tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg desired_contact_01 treat_adherance##treat_nation_fig if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/TableS34.tex, tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg desired_contact_01 i.treat_adherance##treat_nation_fig if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/TableS34.tex,  tex label ctitle(Desired, Contact) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Figure S11

rev DISTANCE_A5, gen(DISTANCE_A5_rev)
label define FemaleSub 1 "Female subject" 0 "Male subject", replace
label values FemaleSub FemaleSub
recode treat_adherance (0 =0 "Control") (1=1 "Gender regressive") (2=.), gen(gender_regressive)

eststo clear
eststo DSC_5_num_DE: reg DSC_6_num i.gender_regressive##FemaleSub if country=="Germany" & norm_type!=. & norm_type!=2 
eststo DISTANCE_A5_rev_GR: reg DISTANCE_A5_rev i.gender_regressive##FemaleSub if country=="Greece"   & norm_type!=2
eststo distance_r5_PL: reg distance_r5 i.gender_regressive##FemaleSub if country=="Poland"   & norm_type!=2 
coefplot (DSC_5_num_DE, label("Geramny")) (DISTANCE_A5_rev_GR, label("Greece"))  (distance_r5_PL, label("Poland"))  , label xline(0) drop(_cons) title("Desired contact (as supervisor)") 
graph export "${PathFig}FigureS11.eps", as(eps) replace


** Table S35

eststo clear
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Germany"
outreg2 using $PathTab/TableS35.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Germany"
outreg2 using $PathTab/TableS35.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Greece"
outreg2 using $PathTab/TableS35.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Greece"
outreg2 using $PathTab/TableS35.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Poland"
outreg2 using $PathTab/TableS35.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Poland"
outreg2 using $PathTab/TableS35.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append


** Table S36

eststo clear
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Germany"
outreg2 using $PathTab/TableS36.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Germany"
outreg2 using $PathTab/TableS36.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Greece"
outreg2 using $PathTab/TableS36.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Greece"
outreg2 using $PathTab/TableS36.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Poland"
outreg2 using $PathTab/TableS36.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Poland"
outreg2 using $PathTab/TableS36.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S37

eststo clear
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Germany"
outreg2 using $PathTab/TableS37.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Germany"
outreg2 using $PathTab/TableS37.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Greece"
outreg2 using $PathTab/TableS37.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Greece"
outreg2 using $PathTab/TableS37.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==1 & country=="Poland"
outreg2 using $PathTab/TableS37.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=1 & FemaleSub==0  & country=="Poland"
outreg2 using $PathTab/TableS37.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append


** Table S38

eststo clear
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Germany"
outreg2 using $PathTab/TableS38.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  replace
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Germany"
outreg2 using $PathTab/TableS38.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Greece"
outreg2 using $PathTab/TableS38.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Greece"
outreg2 using $PathTab/TableS38.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==1 & country=="Poland"
outreg2 using $PathTab/TableS38.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append
reg help_01 i.treat_adherance##i.treat_nation_fig if norm_type!=2 & FemaleSub==0  & country=="Poland"
outreg2 using $PathTab/TableS38.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S40 

eststo clear
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_DE==1 & country=="Germany"
outreg2 using $PathTab/TableS40.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_DE==0  & country=="Germany"
outreg2 using $PathTab/TableS40.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_GR==1 & country=="Greece"
outreg2 using $PathTab/TableS40.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_GR==0  & country=="Greece"
outreg2 using $PathTab/TableS40.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_PL==1 & country=="Poland"
outreg2 using $PathTab/TableS40.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=1 & right_wing_PL==0  & country=="Poland"
outreg2 using $PathTab/TableS40.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append


** Table S41

eststo clear
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_DE==1 & country=="Germany"
outreg2 using $PathTab/TableS41.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_DE==0  & country=="Germany"
outreg2 using $PathTab/TableS41.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_GR==1 & country=="Greece"
outreg2 using $PathTab/TableS41.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_GR==0  & country=="Greece"
outreg2 using $PathTab/TableS41.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_PL==1 & country=="Poland"
outreg2 using $PathTab/TableS41.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig if norm_type!=2 & right_wing_PL==0  & country=="Poland"
outreg2 using $PathTab/TableS41.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S42

egen confFE_PL = concat(treat_nation_fig los_sex los_photo) if country=="Poland"
rename ConfTreatment confFE_DE
egen confFE_GR = concat(PHOTOBIN12M1 PHOTOBIN34M1)
encode confFE_DE, gen(confFE_DE_enc)
encode confFE_GR, gen(confFE_GR_enc)
encode confFE_PL, gen(confFE_PL_enc)

eststo clear
reg therm_01 treat_adherance##treat_nation_fig i.confFE_DE_enc if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/TableS42.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig i.confFE_DE_enc if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/TableS42.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Germany)  append
reg therm_01 treat_adherance##treat_nation_fig  i.confFE_GR_enc if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/TableS42.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig  i.confFE_GR_enc if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/TableS42.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Greece)  append
reg therm_01 treat_adherance##treat_nation_fig  i.confFE_PL_enc if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/TableS42.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig  i.confFE_PL_enc if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/TableS42.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Conf. FE, Yes, Country, Poland)  append


** Table S43

eststo clear
reg therm_01 treat_adherance##treat_nation_fig $controls_de if norm_type!=1 & country=="Germany"
outreg2 using $PathTab/TableS43.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Germany)  replace
reg therm_01 i.treat_adherance##treat_nation_fig $controls_de if norm_type!=2  & country=="Germany"
outreg2 using $PathTab/TableS43.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Germany)  append
reg therm_01 treat_adherance##treat_nation_fig $controls_gr if norm_type!=1 & country=="Greece"
outreg2 using $PathTab/TableS43.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Greece)  append
reg therm_01 i.treat_adherance##treat_nation_fig $controls_gr if norm_type!=2  & country=="Greece"
outreg2 using $PathTab/TableS43.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Greece)  append
reg therm_01 treat_adherance##treat_nation_fig $controls_pl if norm_type!=1 & country=="Poland"
outreg2 using $PathTab/TableS43.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare, Country, Poland)  append
reg therm_01 i.treat_adherance##treat_nation_fig $controls_pl if norm_type!=2  & country=="Poland"
outreg2 using $PathTab/TableS43.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender, Country, Poland)  append


** Table S46

eststo clear
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=1 & two_by_two_work==1 
outreg2 using $PathTab/TableS46.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare)  replace
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=1 & two_by_two_work==2  
outreg2 using $PathTab/TableS46.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=1 & two_by_two_work==3 
outreg2 using $PathTab/TableS46.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=1 & two_by_two_work==4  
outreg2 using $PathTab/TableS46.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Welfare)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=2 & two_by_two_gender==1 
outreg2 using $PathTab/TableS46.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=2 & two_by_two_gender==2  
outreg2 using $PathTab/TableS46.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=2 & two_by_two_gender==3 
outreg2 using $PathTab/TableS46.tex, tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender)  append
reg therm_01 i.treat_adherance##treat_nation_fig cntr2 $controls_gr_pl if norm_type!=2 & two_by_two_gender==4  
outreg2 using $PathTab/TableS46.tex,  tex label ctitle(Closeness) bdec(3) tdec(2) sdec(2) rdec(2) addtext(Norm, Gender)  append


